home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / vir_real / papers / leeimplm < prev    next >
Encoding:
Text File  |  1993-06-20  |  42.2 KB  |  826 lines

  1.             Implementing
  2.               Virtual Reality
  3.               
  4.         Jeremy Lee, 16th July, 1992
  5.  
  6.  
  7.  
  8.     Introduction                1
  9.     The Goal                1
  10.     The Problem                1
  11.     Basic concepts                1
  12.     Virtual Worlds                2
  13.     Object Definition            2
  14.     Process Definition            3
  15.     Distributed processing and Networking    3
  16.     Languages                4
  17.     Processes                4
  18.     Links                    4
  19.     Memory usage                5
  20.     Message passing                5
  21.     Process Identification            5
  22.     Interaction standards            5
  23.     Touch                    6
  24.     Sound                    7
  25.     Vision                    7
  26.     Ownership                8
  27.     Security                8
  28.     The Death of 'God'            8
  29.     Database Models                9
  30.     Syncronicity                9
  31.     Measurement                10
  32.     Rendering                10
  33.     Patch-Process relations            11
  34.     External Interfacing            12
  35.     Conclusion                12
  36.     Copyright Notice            13
  37.  
  38.  
  39.  
  40. Introduction
  41. =========================================================================
  42. Presently, I have no catchy name, so I'll just have to stick to dry names
  43. like "The System" or "Rendering process".
  44.  
  45. The main problem in the field of VR today is the fact that everybody is
  46. doing it. And when everybody does it, then everybody has their own ideas on
  47. how things should be done, and everyone does it differently. Eventually,
  48. one (or two) standards emerge.
  49.  
  50. In the past, this hasn't been too much of a problem, and workarounds have
  51. been devised because in most cases, people have converged on a similar, if
  52. distinct, solutions. VR is not like that. No-one is even presently sure
  53. what VR is. This will lead to confusion, vastly different standards, and
  54. implementations. Once again, this is not too much of a problem in other
  55. areas, but one of the goals of VR is networking, the ability to plug
  56. dozens, hundreds, or thousands of people and realities together. If this is
  57. to be done, then some standards have to be worked out to allow this to
  58. happen. This is probably not such a standard, but it is hoped that the
  59. concepts in this paper will somehow find their way into researchers minds
  60. and leap to the fore when confronted with a particularly tricky situation.
  61.  
  62. The Goal
  63. =========================================================================
  64. The basic Goal of VR is to produce an environment that is indistinguishable
  65. from reality in which certain things can be done or experienced that cannot
  66. normally be done. A commercial flight simulator is an example, in that
  67. people crowd into a mock cockpit, and a massive computer projects images
  68. onto large screens, while the entire assembly is rocked about. To the
  69. people in the cabin, the illusion is often complete, and they totally
  70. believe that they are flying a real plane. What can now be done is trial of
  71. emergency procedures, and extraordinary situations can be tested and tried,
  72. without danger of destroying property or killing the crew.
  73.  
  74. VR seeks to take this one step further by removing the physical "set" and
  75. replacing it with direct sensory input, such as vision, sound, touch, etc.
  76. Current technology has progressed to the stage where Vision and Sound can
  77. easily be simulated with sufficient computing power.
  78.  
  79. To translate this into computing terms, an interactive, multi-participant
  80. system must be built.
  81.  
  82. The Problem
  83. =========================================================================
  84. The problem is that there are far far too many ways that this can be done,
  85. and everybody seems to be going at it from the wrong direction, from the
  86. screen in. Current rendering technology is being used as the basis for
  87. building a VR, and although this produces "results", it is a short-term
  88. system that will reach it's limits very quickly.
  89.  
  90. What has to be done is that an entire paradigm must be invented that takes
  91. care of all of the aspects of a VR, treating the renderer as just a part of
  92. it, indeed, as just a small part.
  93.  
  94. To begin with, we must base our system on reality to some degree. The
  95. concepts that we choose to base it on will affect the way the entire system
  96. is set up, and so they much be chosen carefully. Or, alternately, a system
  97. must be set up where these choices are made unimportant. The internal goal
  98. of the system must be to make an environment that is as flexible as
  99. possible, and one in that (almost) anything can be done.
  100.  
  101. Basic concepts
  102. =========================================================================
  103. I have taken one basic concept from reality, the Object. The way that the
  104. object is viewed and heard can safely be ignored for the present. Suffice
  105. to say that each object interacts with another object in some way. This is
  106. simulated by each object opening a link with another object. This link is a
  107. communications channel, through which information can be passed between
  108. objects. This link is actually a logical extension of a certain component
  109. of an object, discussed later.
  110.  
  111. Everything that occurs between two objects can be considered an
  112. interaction, which again can be considered to be information passed over a
  113. link. Seeing an object is an interaction, so is touching it, smelling it
  114. (if we had the olfactory technology) or anything else.
  115.  
  116. This is the only definition. Every interactive "unit" is considered to be
  117. an object, including the (multiple) observers in the scene. Each object is
  118. capable of interacting with any other object.
  119.  
  120. Virtual Worlds
  121. =========================================================================
  122. The fact that any object can interact with any other object suggests a few
  123. problems. When several thousand objects are active at one time in a
  124. networked environment, how do you partition yourself to interact with only
  125. a specific group of them? Some have suggested the concept of a "Virtual
  126. World" in which you join the world and leave the previous one, jumping
  127. between them as necessary. Others have suggested a similar idea using rooms
  128. and doors, in which leaving by a door is equivalent to moving between
  129. virtual worlds.
  130.  
  131. I would extract the basic premise from these descriptions and say that the
  132. goal here is to choose a sub-group of objects to interact with. All this
  133. requires is for a group of objects to agree to exclusively interact with
  134. each other. there is no need for distinctions like "rooms" and "worlds"
  135. when all you have to do is decide to only interact with a small subset of
  136. all available objects. One suggestion was that the concept of "rooms"
  137. enabled security, and certain doors would be "locked". In the wider view,
  138. objects simply have the right to refuse to pass information with
  139. un-authenticated objects. If every object in the "room" shares this
  140. feature, then even if someone manages to enter the "room" then they still
  141. cannot interact with the objects. Even if an object is taken outside the
  142. room then they still cannot interact with it. Each object is responsible
  143. for it's own security.
  144.  
  145. You will notice that at no point has the concept of a central controller
  146. been raised. This is because one is not necessary, in an object centred
  147. view. Each object must be capable of taking care of itself.
  148.  
  149. Object Definition
  150. =========================================================================
  151. An object is defined as being comprised of a number of processes. Each
  152. process sends messages to other processes. Inter-object links are simply
  153. extensions of inter-process links that occur between objects.
  154.  
  155. The grouping of certain processes into an object is really arbitrary, and
  156. one could supposedly do away with the idea of objects entirely (which in
  157. fact don't really exist outside of the definition that they are composed of
  158. a number of processes) except that they are a convenient method of grouping
  159. processes into functional units.
  160.  
  161. Process Definition
  162. =========================================================================
  163. A process is basically a task, executing in some named language. In fact, a
  164. task could be defined in any language as long as a few criteria are met:
  165.  
  166.     1. Each process is capable of establishing communication links
  167.         with other processes.
  168.  
  169.     2. Each process is capable of starting another object/process
  170.  
  171.     3. Each process can be moved, mid-execution, onto another processor.
  172.  
  173. The first two requirements are simple. The last one is not, and to my
  174. knowledge, has not been investigated before.
  175.  
  176. Can a compiled language be shifted, mid-execution, to another processor?
  177. And I don't necessarily mean a processor of the same type. I am talking
  178. from an IBM to a SparcStation. In a multiprocessor environment, an object
  179. may be copied, or moved, onto another processor. While copying the object
  180. could involve re-compiling and restarting the process, moving it requires
  181. that all internal structures/variables, and execution state be preserved.
  182.  
  183. Example: If each process was a Unix process running in C:
  184.  
  185. In this example, each process would be capable of establishing a
  186. communication link with other processes via library functions and standard
  187. unix calls. If the definition of a process extended to include the source
  188. code, then a process could start another process by issuing a command to
  189. compile it and start the process, passing it some initial information. It
  190. would even be capable of copying and starting itself on another processor
  191. but it would fail the last requirement of being able to be moved, while
  192. running, to any other processor.
  193.  
  194. This requirement of being moved also creates a few other problems, which
  195. can be solved with a little work. First, during the move, a process will be
  196. inactive, and incapable of responding to messages. A queue will have to be
  197. set up to store these messages. But also, once the object has moved, then
  198. messages passed to the original processor have to be passed on to the new
  199. processor, and all other sending processes should be notified that the
  200. process has been moved. We have the same situation were someone is moving
  201. house, and something has to happen to their mail.
  202.  
  203. Why do we need this third requirement, which is making life so difficult?
  204.  
  205. In a distributed system, each object is comprised of many processes. To
  206. distribute the load evenly. processes have to be shifted and moved among
  207. the processors available to the network. This allocation is done
  208. transparently and separately to the individual processes, so that
  209. distribution algorithms can be improved and site-specific parameters can be
  210. taken into account.
  211.  
  212. If processes cannot by dynamically distributed amongst the multiple
  213. processors available, then processes will get "stuck" on certain
  214. processors, resulting in an uneven distribution and wasted processing time.
  215. And what happens when a processing node has to be shut down? The object has
  216. to be moved then.
  217.  
  218. Distributed processing and Networking
  219.  
  220. The fundamentals for networking are already in place, and no doubt
  221. specialist networks will be evolved for VR in time. Any networking details
  222. will be taken for granted.
  223.  
  224. Likewise, since processes are defined as concurrent tasks, which
  225. communicate in a very OCCAM like way, the basics for fine-grained
  226. multiprocessing are in place. The complex tasks of process-processor
  227. allocations and linking is left to the site/machine dependant VR operating
  228. system that individual sites are using. This area has already been
  229. extensively researched, and an appropriate method is no doubt currently
  230. sitting on someone's shelf waiting to be dusted off and put into place.
  231.  
  232. Languages
  233. =========================================================================
  234. Any language that the VR supports must be capable of performing the above
  235. mentioned tasks. I can only guess at what such a VR language will look like.
  236.  
  237. It will probably not be a current language. The requirements are beyond the
  238. specifications for any current language. The saving grace of the system is
  239. that multiple languages can be defined and implemented, as long as they can
  240. communicate, start other encapsulated processes, and be encapsulated. Of
  241. course, if one machine cannot handle a process defined in a particular
  242. language, then it will have to be run on another that can support it.
  243. Eventually on or two languages should emerge.
  244.  
  245. As long as they adhere to the rules that the OS lays down, there should be
  246. no problem.
  247.  
  248. Processes
  249. =========================================================================
  250. As mentioned earlier, processes are defined in some language, and must
  251. perform a few basic tasks such as linking to other processes, starting new
  252. processes, and being encapsulated for transmission.
  253.  
  254. Whatever language it is, must be available on all VR machines that are
  255. going to want to support the object in any way. Multiple or alternate
  256. languages may be produced, but objects defined with processes of this type
  257. will not be portable (or in some cases viewable) on machines that do not
  258. support this language. Any language produced must be implemented in the
  259. vast majority of VR systems before it begins widespread use, as
  260. incompatibility problems will definitely eventuate with older systems.
  261.  
  262. Of course, there will be cases when specific processes will be tied to
  263. particular machines. For example, processes that control external
  264. pheriperals like gloves, speakers, and displays. These processes must be
  265. marked as "immovable" in some way. No doubt, some people will take
  266. advantage of this facility to define immovable processes that do specific
  267. things, but objects built from these processes can never be copied, or
  268. moved. Again, this is fine for some applications.
  269.  
  270. Links
  271. =========================================================================
  272. Links are object pointers that can be changed without the processes being
  273. completely aware. An object can open a link (in much the same way as
  274. opening a file) and then later redirect or close the link, or open new
  275. ones. All subsequent code needs to know is the internal handle of the link
  276. (in the same way that file code uses and internal file handle that is
  277. created from opening a named file) to do operations.
  278.  
  279. Opening a link does not necessarily mean that during the life of the link,
  280. that information is continually flowing. The operating system does not
  281. continuously check the validity of the link (although it will do it's best
  282. to make sure it is current and correct) although the objects are perfectly
  283. at liberty to do so. It is even possible to open a link, and then close it,
  284. without a single byte being sent.
  285.  
  286. To open a link requires knowledge of the object/process number of the
  287. process at the other end. Links are one-way, and if the remote object
  288. wishes to respond, then it must open a link of it's own. Information is
  289. sent down the link, and the sending object must not expect a reply, but
  290. should be able to act on one. Deadlocking in such a distributed system may
  291. be difficult to correct.
  292.  
  293. Memory usage
  294. =========================================================================
  295. In a VR system, how is memory allocated? First, there is no concept of a
  296. file. All available disk space should be dedicated to use as one large
  297. Virtual Memory. If you require the same functionality as a file, then
  298. create a process/object that acts simply as a data storage block, and
  299. sends/receives this data on request.
  300.  
  301. All objects are active at any one time, but standard VM algorithms should
  302. ensure that relatively unused portions of processes, such as large memory
  303. stores, stay relatively inactive on disk.
  304.  
  305. Message passing
  306. =========================================================================
  307. When a message is passed down a link, what form should it take? It will
  308. basically be one large block of data, roughly equating to a spooled file or
  309. a pipe, for the remote process to do with as it will. Traditional
  310. handshaking and error checking will be done transparently by the OS.
  311.  
  312. This method is by far the most flexible and future-proof. Processes can
  313. encode these blocks in whatever format they require, but every object will
  314. be capable of sending, receiving, and passing on these blocks, even if they
  315. are unaware of their content. Of course, most languages will have standard
  316. commands to insert and extract data from these variable length message
  317. blocks, most likely following similar methods as standard file operations.
  318. Most languages should also treat each block as one largish variable or
  319. string, which is dynamically resizeable.
  320.  
  321. Process Identification
  322. =========================================================================
  323. Each object is somehow given a unique ID number, that no other object can
  324. possibly share. I still don't know how this can be done, and any
  325. suggestions are welcome.
  326.  
  327. Within each object, processes are given unique process numbers, which is
  328. easy. If a process wants to open a link inside the object, the it simply
  329. uses the process number. If it wants to open a link with another process
  330. outside the object, then it also has to give the object number. Process
  331. numbers should not change during the lifetime of a process, and are
  332. reusable.
  333.  
  334. Note that process numbers may repeat across objects, but if the object
  335. numbers are unique, then there should be no problems.
  336.  
  337. Interaction standards
  338. =========================================================================
  339. So far I have talked about how the objects are built, and how they pass
  340. messages. What most people want to know is how to draw things on the screen
  341. and play with them with their powerglove. This section deals with that
  342. aspect.
  343.  
  344. Each object is a completely independent entity, containing all the
  345. necessary information about itself. It, however, must also broadcast
  346. information via links to other objects that may be interested. The other
  347. objects that may be interested constitute the "world" as far as the
  348. original object is concerned (see "Virtual Worlds") When something happens
  349. to an object, it generates messages that get sent to the other objects that
  350. "need to know". In the past the other objects may have requested to be
  351. notified of this information.
  352.  
  353. The great problem is that you are never sure how the other objects are
  354. defined. Some may be defined as triangular facets, others a b-splines,
  355. others as CSG models. They make be texture or bump mapped. They may be
  356. transparent, reflective, light emitting. There are even new types of
  357. graphics objects appearing, and no doubt other ones will appear in future.
  358. The point is that we must not make assumptions in the VR system about what
  359. types of "physical" object representations are supported. We must be able
  360. to support any and all types. If proper process encapsulation is provided,
  361. then this is not difficult, because only the object itself needs to know
  362. exactly how it is defined.
  363.  
  364. Touch
  365. =========================================================================
  366. This occurs when two objects "collide".
  367.  
  368. When the "physical" aspect of an object changes, then a message is sent to
  369. the other objects detailing a minimum piece of information with which the
  370. other objects can respond, such as the centre and bounding sphere of the
  371. modified object. If other objects detect that this bounding sphere
  372. intersects with their own bounding spheres, then further messages will pass
  373. between them.
  374.  
  375. Each object much be able to tell whether any part of it is present in a
  376. given volume of space, and whether that part is surface or interior (in
  377. solid models as opposed to surface models).
  378.  
  379. Once the two objects are convinced that a possible intersection has taken
  380. place, possibly though the exchange of a more accurate bounding model, or
  381. on past experience (the object were intersecting just before, and now they
  382. have moved closer as opposed to further away.) then the following recursive
  383. algorithm is executed.
  384.  
  385. An initial bounding box is calculated, most likely encompassing the
  386. intersection of the two bounding spheres. This bounding box is then
  387. recursively divided into two sub-boxes, by division along the edge that is
  388. longest, or by choosing a random edge if there are two or more edges that
  389. are equally the longest.
  390.  
  391. For each sub-volume, both of the object determine if they occupy it. If
  392. both do, then that sub-volume is also recursively divided. If neither or
  393. only one object is present in the volume, then no intersection is possible
  394. within that volume, and it is discarded. This recursive division continues
  395. until the volume of the bounding box is indistinguishable from a point.
  396. (ie. when one of the objects decides that they are definitely probably
  397. intersecting as far as they are concerned.)
  398.  
  399. By this stage there will most likely be quite a number of intersection
  400. points. This will provide a large enough sample group to decide at what
  401. angle the objects are intersecting. Another brief conversation should
  402. happen about the relative velocity, momentum, spin etc. of the objects, and
  403. they should then agree on what happens next.
  404.  
  405. "What happens next" is completely unknowable. Since each objects is an
  406. independent entity. One may decide to follow the normal laws of newtonian
  407. physics and "bounce" off the other. The other object may decide to ignore
  408. and continue doing whatever it was doing. One object may decide to emit a
  409. sound ("Ouch" perhaps?) or dent, or disappear entirely. Note that since the
  410. objects have come in contact, they are now free to record this fact and use
  411. it to pass messages in future. Since any message may be passed when the
  412. objects have decided they they have come in contact, then anything is
  413. possible. Some "rules of object etiquette" should be formulated to let the
  414. objects interact in a cultured and friendly manner, such as giving
  415. suggestion to the other object about what should happen next. If a "hand"
  416. object grabs an object, then the other object is better to respond to the
  417. directions of the hand object and smoothly follow it then jerkily bounce
  418. off the fingers that hold it.
  419.  
  420. Also, to speed the process up, the bits of code that do all the checking
  421. may be sent to the other process as an encapsulation, where they can be
  422. started up (as described below), and all the collision checking can be done
  423. within one object! However, unless the hardware controlling one object is
  424. significantly faster, this will not be terribly beneficial. (as one machine
  425. is now doing all the work instead of two.)
  426.  
  427. Sound
  428. =========================================================================
  429. There are two approaches to sound. When two objects are aware that they are
  430. in the same "world", then they may simply send packets of sound information
  431. to the other objects by establishing links between the sound generation
  432. processes in each object.
  433.  
  434. With the second method, when two objects become aware of the other, then
  435. they may exchange encapsulated processes that generate the same sound. If
  436. one object regularly generates a "Beep" sound, then instead of sending the
  437. same "beep" sound sample every time, then it can send an encapsulated
  438. process in a message for the other object to start up, which will form a
  439. link with the original object. when a "beep" is needed, then the object
  440. sends a control message to the process that is now embedded in the other
  441. object, which produces the same effect.
  442.  
  443. Why this logical shuffling? Because processes that constitute an Object are
  444. more likely to be more closely related, and have faster communication
  445. links. When shifting around large data blocks, this can be important.
  446.  
  447. Vision
  448. =========================================================================
  449. This is done in a similar method to the sound generation method above.
  450.  
  451. Once objects become "aware" of each other, then they exchange encapsulated
  452. processes that render them. This allows, in many cases, the rendering
  453. procedure to be done in the one VR processor, with minimal communication
  454. with other objects that simply update their embedded processes with the new
  455. position/orientation/shape of the object. All the hard rendering is kept
  456. within the one object, and the advantages are obvious, since you can
  457. control your own object much more easily than another.
  458.  
  459. Since different machines are more/less powerful than others, then the
  460. "type" of process you request when your "eye" object becomes aware of other
  461. objects will vary.
  462.  
  463. This leads on to "multiple views"
  464.  
  465. The term is a misnomer, because it is not only vision that will require
  466. this. Sound will also benefit from this, and also other interaction methods
  467. to come.
  468.  
  469. When an object requests to be sent a process to handle vision/sound for the
  470. remote object, it may also specify what "level" of handler to send back.
  471. For example, a slow machine may request to remote object to send a process
  472. that renders it as a wireframe. A faster machine may request to be sent
  473. processes that render the remote object as a raytraced b-spline construct.
  474. An intelligent machine may choose to render some in one form, an some in
  475. another depending on distance, or how much processing bandwidth is
  476. available. If more objects are added to it's "world view", then it may
  477. begin rendering some of the original objects in a less intensive format so
  478. that the frame rate remains steady. Also, if you begin "physically"
  479. interacting with an object, you may change it's representation to either a
  480. higher form (to show exactly what you are doing) or a lower form. (to save
  481. communication bandwidth)
  482.  
  483. You might perceive a problem if a scene becomes too complex, and the local
  484. process cannot handle the number of processes that it would be necessary to
  485. load. The local process can always fall back on leaving the process in the
  486. remote object (probably increasing net traffic) or taking other steps, such
  487. as only rendering those objects that are closest.
  488.  
  489. The local object can also make intelligent decisions, like rendering an
  490. object as a lower level graphic when it is further away, or if it past a
  491. certain point, or too small, not rendering it at all.
  492.  
  493. The same applies to sound, or any other interaction medium. If, for
  494. example, an object did not respond to a request to supply a sound process,
  495. then it can be assumed that it won't be making any sounds.
  496.  
  497. This means that each "interested" object builds up a dynamic library of
  498. remote objects' processes that enable each object to independently render
  499. the remote objects with minimal input from them. Once a process is no
  500. longer needed, it is terminated, and it's links severed. (In that order.)
  501.  
  502. Ownership
  503. =========================================================================
  504. In this model, there is no real concept of ownership. Each object is
  505. self-owning, and no other object has control over it except itself. Of
  506. course, each user has control over their own machines, and if an object is
  507. in residence, then they have the power to do whatever they wish to it. This
  508. is how object building and testing would be done. It is expected that there
  509. will be a core routine in each object that responds to commands from
  510. outside, authenticated sources to perform actions, such as self
  511. modification. So, although no other object controls it directly, it can
  512. send commands for the object to perform on itself.
  513.  
  514. Security
  515. =========================================================================
  516. If an object wishes to remain secure, then a pre-requisite to communicating
  517. with that object may be engaging in a challenge-response authentication
  518. system, or sending some sort of code along with every message.
  519.  
  520. Since messages are contained within a standard data block, then there is no
  521. reason why it cannot be encrypted before transmission. The secure object
  522. may even send a process to the other object that is used to decrypt the
  523. data.
  524.  
  525. Refusing to respond to messages from certain objects also means that the
  526. secure objects will remain "invisible" to them.
  527.  
  528. The Death of 'God'
  529.  
  530. 'God' is a term that I coined for an omniscient, all powerful central
  531. controller, which seems to have passed into general use.
  532.  
  533. Using the object based model described here, it is easy to see that there
  534. is no longer any concept of a God. A central controlling process would not
  535. necessarily make things more efficient, and could even degrade performance.
  536. A central server destroys the goal of a truly distributed system, and
  537. forces a situation where all messages and commands must be forced through a
  538. central machine.
  539.  
  540. 'God' was invented in order to solve the problem of partitioning Virtual
  541. Worlds into manageable chunks, with a central controlling process for each
  542. world. As you have seen in the section "Virtual Worlds", this is not
  543. necessary, as each object is capable of making the distinction on it's own.
  544. In fact, this allows greater flexibility as some objects are now able to
  545. communicate with objects that are "outside this world", and provide
  546. services equivalent to doors and telephones. You can envisage a problem
  547. where half of a world is interacting with objects that the other half
  548. doesn't know about, but effective communication standards where objects
  549. share common data should prevent this. As always, it can be though of
  550. either as a feature or a bug.
  551.  
  552. Database Models
  553. =========================================================================
  554. A lot of VR systems currently work on a database system, where each object
  555. is represented as a collection of data describing many attributes of the
  556. objects. This system requires a large central database manager to make the
  557. objects appear as active things. Once again we run across the problem of
  558. centrality, which gives rise to many problems, while solving others.
  559.  
  560. The main issue is that you inevitably end up with a lot of the problems
  561. associated with multi-users and traditional Database systems, in this case
  562. with possibly several hundred users trying to get at the same information
  563. at the same time. Also, a Database model incorporates some restrictions
  564. that are almost impossible to get around if future expansion is wanted.
  565.  
  566. Also, the Database will be difficult to distribute amongst parallel
  567. processors and retain all the advantages that the traditional Database
  568. approach solves. If you keep it all on the one platform, then you will
  569. eventually hit a ceiling where even the fastest computers can't handle any
  570. more.
  571.  
  572. Then, when you want to plug several databases together, you will end up
  573. either with a horrible mess, or a system that will seem surprisingly like
  574. the one listed here. Once can think of my object centred model as a large
  575. number of small databases which communicate using a built-in protocols, so
  576. in effect what I am talking about is an intelligent distributed DBMS.
  577.  
  578. Syncronicity
  579. =========================================================================
  580. In a distributed system, it is difficult to make sure that everything that
  581. was supposed to happen synchronously does. This is basically a network
  582. problem, and will hopefully be solved as networks get faster.
  583.  
  584. Should timestamps be put on messages? Yes. What is done with those
  585. timestamps depends on the object that receives them.
  586.  
  587. We also encounter a problem when a process begins sending messages to
  588. another process at a greater rate than the receiving process can cope with.
  589. This will lead to a huge queue, and eventually something will break. Most
  590. likely the OS will just drop the messages. Again, this is a problem that
  591. can only be solved by intelligent coding of the objects, perhaps in the
  592. form of handshaking.
  593.  
  594. But, as networks go at different speeds, might not you have the problem
  595. that causality will seem to be violated in certain cases, when multiple
  596. viewers are out of synch with each other? Unfortunately yes, but there is
  597. little that can be done. A similar thing happens within the framework of
  598. general relativity, and the real universe seems to cope there.
  599.  
  600. Measurement
  601. =========================================================================
  602. How do we measure the various aspects of a Virtual World? Time will
  603. obviously be measured in seconds, or fractions of a second. Date/time
  604. stamps already are well understood and in standard use. Most interactive
  605. tasks between human users and objects will proceed at an average pace, but
  606. when object-object interactions are concerned, the speed of the
  607. interaction, whatever it's form, is only limited by the speed of the
  608. hardware. If the user wants it to slow down, then they will have to find a
  609. way to instruct the objects of that request.
  610.  
  611. One distracting question is how to measure spatial co-ordinates. 16 bit
  612. numbers are insufficient, and floating point numbers suffer from decreasing
  613. accuracy the further away you get from the origin.
  614.  
  615. The problem is that you may wish to model objects and events of any size,
  616. from sub-atomic quarks to galaxys. Some have suggested a "world scaling"
  617. index, but as there is no central server, this may be difficult to enforce.
  618. also, what if you want an object the size of a quark along with an object
  619. the size of a galaxy in the same world? To say "This should not happen" is
  620. to set an artificial limit on a VR.
  621.  
  622. The best solution is to use a numbering system that can cope with the two
  623. extremes with constant accuracy. Floating point numbers, although they can
  624. cope with the range, are subject to variable accuracy. The best solution
  625. then is to use a large integer, and the use of 128 bit integers has been
  626. suggested, as they can express the range of events present in the "real
  627. universe"
  628.  
  629. If these numbers are used to define each of the x,y,z axes, then a large
  630. cube results. At the boundarys, simply wrap around. Again a similar thing
  631. happens in the real universe. If you go far enough in one direction, then
  632. you end up where you started.
  633.  
  634. Some have challenged this on two fronts. First, that for most machines it
  635. would be faster and more efficient to process 16 or 32 bit integers, but as
  636. already said, these are insufficient, and anyway, a scaling factor would
  637. also have to be used, resulting in a degradation of performance. Also,
  638. since the numbers are integers, operations performed on them should take
  639. less time than equivalent operations on floating point numbers, which are
  640. also in widespread use.
  641.  
  642. Second, some say that the use of such large numbers will increase memory
  643. usage and network bandwidth. this is true, but Virtual World co-ordinates
  644. need not necessarily be used at all times. There will be only a limited set
  645. of times when number of this precision will be needed, generally to specify
  646. an overall position for the object. After this, smaller offset values can
  647. be intelligently supplied as needed.
  648.  
  649. Also, most of the traffic in absolute positions will be in messages
  650. notifying other objects of a movement, and network packets carrying this
  651. information will generally be larger than the amount of the data being
  652. transmitted anyway.
  653.  
  654. Rendering
  655. =========================================================================
  656. The front end of VR, the rendering interface (which is often mistaken for
  657. the entire VR) has now been defined in an almost infinitely flexible way,
  658. which is not what most people want.
  659.  
  660. In most rendering systems, there are two broad rendering models, view
  661. dependant and view independent.
  662.  
  663. Diffuse lighting takes into account ambient light, radiated light from
  664. other sources, and shadows. These are the view-independent parts of any
  665. lighting model.
  666.  
  667. Opposite to this are the specular lighting models, and reflection, which
  668. make up the view dependant sections of any viewing model
  669.  
  670. The best way to deal with the view-independent model is to use a radiosity
  671. algorithm, which will quite happily generate the relevant information. This
  672. information is then incorporated into the objects themselves, by changing
  673. the colour/intensity of the visible parts that make them up. As you might
  674. have guessed, this can be implemented by each objects computing it's own
  675. hemicube and form factor information, and then passing messages. The job of
  676. radiosity computation is distributed amongst the objects that make up the
  677. world. Intelligent decisions can also be made dependant on the distance
  678. between objects, and whether certain objects only emit or reflect or absorb
  679. light.
  680.  
  681. The view dependant parameters have to be calculated by the rendering object
  682. that is "viewing" the scene. This is obviously done with the help of
  683. processes loaded from the other objects in the scene. The simplest way to
  684. handle this lighting model is to use raytracing. Unfortunately, raytracing
  685. is still a fairly CPU intensive process, and may not be practical for low
  686. end machines.
  687.  
  688. If a raytracing algorithm is chosen for final rendering of the radiosity
  689. model, then a good algorithm to choose is the Wallace, Cohen, and Greenberg
  690. two-pass approach [SIGGRAPH 87, p211] which uses reflection frustrums to
  691. combine the models.
  692.  
  693. Low end machines will simply ignore any of the extra information present,
  694. and will stick to their wireframes. Any other processes viewing them will
  695. likewise see only the highest visual model that has been assigned to them.
  696. If the creator has gone to the trouble to define solid surfaces, despite
  697. the fact that they may not be able to see them, then higher powered
  698. machines will still be able to use them. Also, only the objects that are
  699. interested will be able to exchange messages to do radiosity. Objects that
  700. are not interested will simply have solid-colour surfaces, and will not
  701. respond to lighting models.
  702.  
  703. It is suggested that only radiosity light objects are defined, and point
  704. sources are ignored. If an object cannot handle being illuminated by an
  705. area light source, then it must render itself as a solid colour.
  706.  
  707. Of course, the method that each renderer uses depends on what sort of
  708. rendering process it requests from the remote objects. If it supports only
  709. wireframes, then the requested processes must be of the lowest level, which
  710. only draws lines. The next step up may involve requesting processes that
  711. draw into a Z-buffer. Each object in turn should be able to supply a number
  712. of different rendering processes.
  713.  
  714. The way that objects request rendering processes from other objects is
  715. arbitrary, and follows similar guidelines to the way in which it requests
  716. processes to "render" other interactions such as sound, or touch.
  717.  
  718. If a particular user does not like the way in which a particular object is
  719. rendered, then they are perfectly at liberty to change the object to suit
  720. their tastes.
  721.  
  722. Patch-Process relations
  723. =========================================================================
  724. I define a "patch" as any graphics/"physical" object that the system
  725. supports. From a rendering perspective, this means a quadratic patch, or a
  726. polygon patch, or any other graphics object.
  727.  
  728. I suggest allocating one process to each of the patches that objects are
  729. built from. Simple pipelines allow the other processes in the object to
  730. alter the patch, but all the work regarding rendering the patch (in all
  731. it's forms) and collision detection is left up to that process. This
  732. process can be copied (for use in other objects) or replaced entirely with
  733. a newer process, which extends the functionality with the same interface to
  734. other processes.
  735.  
  736. For example: You may define a patch/process pair (really the patch only
  737. exists as a data structure within the process) for a triangular facet, with
  738. flat shading. This process is capable of setting and rendering all the
  739. aspects of this patch, including encapsulating and sending the process of
  740. the appropriate level to another object, and maintaining contact with that
  741. other process. It is also capable of detecting if the facet is within a
  742. specific volume of space to aid in collision detection. This process can be
  743. copied a number of times to produce a number of patches. A controlling
  744. process simply has to send gross feature updates such as a change in
  745. colour, or new vertices co-ordinates.
  746.  
  747. At some future time, it is decided to replace this process with one that
  748. implements a radiosity method. As far as the controlling process is
  749. concerned, it still only tells the patch process gross feature information,
  750. but now the patch process does a lot more work in terms of communicating
  751. with other patch processes to evaluate it's final surface values from the
  752. radiosity methods. The radiosity method may also require that the patch
  753. subdivide, and the process will handle this transparently (perhaps starting
  754. up new processes). As far as the controlling process is concerned, nothing
  755. has changed, and the remote rendering process also sees an unchanging
  756. interface (although it may now be doing slightly more work).
  757.  
  758. An extension may allow a patch process to detect when it has intersected
  759. with another object, and send another message when this happens. the patch
  760. will then act like a "button". When it is pressed, then an action occurs.
  761. Again, the fundamental method of rendering the patch may change
  762. drastically, but the same final result is produced when it is pressed.
  763.  
  764. As the machine(s) that an object is running on become more powerful, then
  765. these path processes may be transparently upgraded without having to change
  766. any of the rest of the object. This in effect leads to a highly modular
  767. structure within the object.
  768.  
  769. External Interfacing
  770. =========================================================================
  771. Within each language, there must be some way to communicate with the
  772. machine running the process, in order to communicate with external
  773. peripherals and conventional programs that may be running on the machine.
  774. For instance, one process that constitutes a user object may read the
  775. information coming from a dataglove. This process cannot be moved from the
  776. processor on which it is running, and this condition must be flagged.
  777. Another object may be in contact with another, conventional program, or
  778. with the operating system itself, so that manipulations of that object are
  779. equivalent to sending commands to the OS.
  780.  
  781. Conclusion
  782. =========================================================================
  783. There are a lot of people trying to fit round old concepts into the new
  784. square hole of VR. Static processes and OO design is one such area. For
  785. various reasons, a traditional OO approach will not work, due to the fact
  786. that each object is an independent entity, and a hierarchal model is vastly
  787. impractical. Things such as the concept of "Rooms with impenetrable walls"
  788. is a workable solution to the problem of overload, but vastly limiting.
  789. Even the basic concept of how a program relates to it's processor has been
  790. redefined.
  791.  
  792. There is also much to be said on the social and societal impacts of VR, in
  793. both directions. The culture that will be using VR is already in place,
  794. waiting for the technology. The first group to get their hands on real VR
  795. will be the inhabitants of the Global Village. Also, expectations of VR are
  796. far outpacing even the technological advancement, leading to the sort of
  797. collapse that befell AI and left it floundering without funding for a
  798. decade.
  799.  
  800. Hopefully, I have provided some new thoughts on the matter, and provided a
  801. little new knowledge and light on the vast area of VR. There is so much
  802. more to say, specifically on the exact implementation details of specific
  803. sub-sections such as vision, sound, and the definition of a real language,
  804. but I think I will leave that for future papers.
  805.  
  806. Copyright Notice
  807. =========================================================================
  808. This document is ) by Jeremy Lee, July 1992. I grant the rights for limited
  809. reproduction of this document for research purposes. I retain the
  810. publication rights, and anyone wishing to publish this should contact me.
  811.  
  812. As far as I know, this work is original and therefore I morally hold the
  813. intellectual rights, but I encourage people to think about and use the
  814. concepts herein, under the understanding that I will be credited.
  815.  
  816.             Jeremy Lee, 16th July, 1992
  817.  
  818.                 Bond University,
  819.               Gold Coast, Australia
  820.               
  821.             s047@sand.sics.bu.oz.au
  822.  
  823.                or contact the Uni.
  824.                
  825.  
  826.